<%@ page language="java" pageEncoding="UTF-8"%>
<html>
<head>
<%@ include file="/jsp/commons/path.jsp"%>
<%@ include file="/jsp/commons/head.jsp"%>
<%@ include file="/jsp/commons/easyui.jsp"%>

<script type="text/javascript">
$(document).ready(function() {
	var saveUserId = '${isUserIdRemember}';
	if (saveUserId == 'true') {
		$('#isUserIdRemember').attr('checked', 'checked');
		$('#userName').val('${userId}');
		$('#password]').focus();
		return;
}
});




//保存或提交
function login() {
	var userName = $.trim($('#userName').val());
	var password = $.trim($('#password').val());
	
	$.ajaxEx({
		type : 'post',
		url : '${ctx}/login/login.do',
		data : {
			userId : userName,
			password : password,
			isUserIdRemember : $("#isUserIdRemember").attr("checked")=="checked",
			
		},
		dataType : 'json',
		success : function(data) {
			var result = data.result;
			if(result == 'success') {
						window.location.href = '${ctx}/jsp/admin/home.jsp';
					} else {
						$.messager.alert('提示', '操作失败！<br />' + data.error, 'error');
					}
		},
		error : ajaxError
	});
}
  
</script>
 
</head>


<body>

 
<div region="north" class="easyui-panel" iconCls="icon-title" border="false" style=" height: 116px">
	<table class="table2"  search="login" style="border-bottom: 1px solid #ccc">
		<tr height="60px">
			<td style="padding-left: 20px;">
				客户姓名：
				<input id="userName" type="text" style="margin-right: 50px" />
				证件号码：
				<input id="password" type="password" style="margin-right: 50px" />
				 
				记住账号：
				<input id="isUserIdRemember" type="checkbox" value="1" style="margin-right: 50px" />
				 
			</td>
			<td align="right">
				<a href="#" class="easyui-linkbutton" icon="icon-search" onclick="login()" style="margin-right: 10px">登录</a>
				<a href="#" class="easyui-linkbutton" icon="icon-redo" onclick="reset()" style="margin-right: 20px">重置</a>
			</td>
			
		</tr>
		
	</table>
</div>

</body>
</html>
